$(document).ready(function(){
    $("#search").focus(function(){
        $(this).val("Hello")
    });
    $("#img").click(function(){
        $(this).animate({height:this.height*2,width:this.width*2},1000);
    });
    $("#main-table").dblclick(function(){
        $("td>a").css("backgroundColor","#FFEE00")
    })
    $("#main-table tr:even").css("backgroundColor","#00ff00")
    $("#head-nav").mouseenter(function () {
        $(this).css("marginLeft","20px")
    }).mouseleave(function () {
        $(this).css("marginLeft","")
    })

    $("#test-button").click(function () {
        var rand = parseInt(Math.random()*100);
        if (rand < 25){
            $(this).animate({top:"+=300"},1000)
        }

        if ( (rand >= 25) && (rand < 50)){
         $(this).animate({left:"+=300"},1000)
         }

        if ((rand >= 50) && (rand <= 75)){
            $(this).animate({left:"-=300"},1000)
        }
        if (rand > 75){
            $(this).animate({top:"-=300"},1000)
        }
         })
    });